<%-- 
    Document   : AddComentEjer
    Created on : 02-mar-2012, 22:33:39
    Author     : jaime
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="exercise.comments"></bean:message></title>
    </head>
    <body>    

        <h1><p><bean:message key="exercise.comments"></bean:message></p></h1>
        <logic:iterate  name="commentlistAdmin"  id="cm" indexId="pos">


            <c:choose>
                <c:when test="${pos%2==0}">
                    <div style="background-color: #8B98AB">
                        <bean:message key="usuario.comments"></bean:message>
                        <b><i>${cm.usuarios.alias}</i></b>
                        <bean:message key="comento.comments"></bean:message><br>
                        <b><i>${cm.comentario}</i></b><br>
                        ${cm.fecha}<br><br> 
                        
                        <html:link action="/reportcomment.do?idComentario=${cm.idcomentario}">Reportar</html:link>
                    </div>
                </c:when>

                <c:otherwise>
                    <div style="background-color: #657b83">
                        <bean:message key="usuario.comments"></bean:message>
                        <b><i>${cm.usuarios.alias}</i></b>
                        <bean:message key="comento.comments"></bean:message><br>
                        <b><i>${cm.comentario}</i></b><br>
                        ${cm.fecha}<br><br>  
                        
                        <html:link action="/reportcomment.do?idComentario=${cm.idcomentario}">Reportar</html:link>
                    </div>
                </c:otherwise>
            </c:choose>



        </logic:iterate>     

        <b><bean:message key="exercise.newComentario"></bean:message></b><br>
        <html:form action="/AddCommentForm?id=${param.idej}">
            <html:textarea property="comentario" cols="70" rows="5" ></html:textarea><br>
            <html:submit><bean:message key="button.submit"></bean:message></html:submit>
        </html:form>
    </body>
</html>
